<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<%
	request.setCharacterEncoding("UTF-8");
	String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <%@ include file="/WEB-INF/JSP/backHome/modalWindows/carList.jsp" %>
 <%@ include file="/WEB-INF/JSP/backHome/modalWindows/CoachesListPageByCarRefuel.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/argeeCommon.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/againstAuditCommon.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
</head>
<style>
select{width: 234px;height: 31px}
.gn_name{padding-top: 5px}
.div_zilei{padding-left: 90px;height: 30px}
.tr{height:40px;background: #57a0ff;font-weight:700;}
.tr td{font-size: 14px;color: #ffffff}
.tr_td{height: 40px;}
.tr_td td{border-bottom: 1px solid #ededed;text-align: center;}
tr td:nth-child(1) {font-size: 14px;color: #cccccc}
.date{border: 0;background: #ffffff;text-align: center;}
.tr_td td:nth-child(1){border-left: 1px solid #cccccc;}
.tr_td td:nth-child(3){border-right: 1px solid #cccccc;}
.addTable.deleteTable:HOVER{cursor:pointer;}
input[type='checkbox']{width: 15px}
.fseq2{border: none;color: #cccccc;text-align: center;}

.subtn3 .subtn4  .subtn6{
	background: #57a0ff;
	border-radius: 50px;
	background: -webkit-linear-gradient(top, #57a0ff, #57a1ff);
	background: -moz-linear-gradient(top, #57a0ff, #57a1ff);
	background: linear-gradient(top, #57a0ff, #57a1ff);
	background: -ms-linear-gradient(top, #57a0ff, #57a1ff);
	border: 1px solid #2576A8;
	box-shadow: 0 1px 2px #8AC1E2 inset, 0 -1px 0 #57a0ff inset;
	color: #fff;
	height: 40px;
	text-shadow: 1px 1px 0.5px #22629B;
	outline: none;
}
.findBtn3 .findBtn4  .findBtn6{
	background: #427dff;
	border-radius: 50px;
	background: -webkit-linear-gradient(top, #57a0ff, #57a1ff);
	background: -moz-linear-gradient(top, #57a0ff, #57a1ff);
	background: linear-gradient(top, #57a0ff, #57a1ff);
	background: -ms-linear-gradient(top, #57a0ff, #57a1ff);
	border: 1px solid #2576A8;
	box-shadow: 0 1px 2px #8AC1E2 inset, 0 -1px 0 #57a0ff inset;
	color: #fff;
	height: 40px;
	text-shadow: 1px 1px 0.5px #57a0ff;
	outline: none;
	margin-left: 100px
}
 .modal-data3 {
			  visibility: hidden;
			  z-index: 1001;
			  width: 70%;
			  min-height: 500px;
			  margin:100px -130px;
			  background-color: #FFFFFF;
			 /* border: 1px solid #C80B14;*/
			 -moz-box-shadow:0 10px 20px #8AC1E2 inset,0 -10px 0 #57a0ff inset;
        	 -webkit-box-shadow:0 10px 20px #8AC1E2 inset,0 -10px 0 #57a0ff inset;
      /*         box-shadow:0 0 10px #cccccc;
			  box-shadow: #cccccc; */
			  box-shadow: 0 10px 20px #57a1ff inset,0 -10px 0 #57a0ff inset;
			  padding: 5px;
			  text-align: center;
			  position: fixed;
			  left: 22%;
		}

		.modal-data3 td{padding-left: 15px;padding-right: 15px}
		.modal-data3 tr:FIRST-CHILD td{padding: 0px 10px;}
		.modal-data3 tr{padding-top: 30px}
		.modal-data3 form table {
			margin: 0px
		}
.modal-data4 ,.modal-data6{
	visibility: hidden;
	z-index: 1001;
	min-height: 500px;
	margin: 100px auto;
	background-color: #FFFFFF;
	-moz-box-shadow: 0 10px 20px #8AC1E2 inset, 0 -10px 0 #57a0ff inset;
	-webkit-box-shadow: 0 10px 20px #8AC1E2 inset, 0 -10px 0 #57a0ff inset;
	box-shadow: 0 10px 20px #57a1ff inset, 0 -10px 0 #57a0ff inset;
	padding: 5px;
	text-align: center;
	position: fixed;
	left: 22%;
}
.modal-data4 td{padding-left: 15px;padding-right: 15px}
		.modal-data4 tr:FIRST-CHILD td{padding: 0px 10px;}
		.modal-data4 tr{padding-top: 30px}
		.modal-data4 form table {
			margin: 0px
		}
</style>
<body style="background: #f5f5f5">
<div class="main">
<div id="modal-overlay">

		</div>

		<div class="weizhi">
			<c:if test="${carRefuel.cfbillstate eq 3 }">
				车辆管理>>驾校车辆加油登记>>修改
			</c:if>
			<c:if test="${carRefuel.cfbillstate eq 4 || carRefuel.cfbillstate eq 5 }">
				车辆管理>>驾校车辆加油登记>>查看
			</c:if>
		</div>
		<div class="modal-data3">
			<div style="height: 60px">
				<ul>
					<li
						style="text-align: left; margin-left: 60px; height: 40px; line-height: 40px">
						<span>名称：</span> <span> <input class="name3" type="text">
					</span> <span>
							<button class="findBtn3">查询</button>
					</span>
					</li>
				</ul>
			</div>
			<div style="width: 1100px; height: 350px; overflow: scroll;">
				<form action="">
					<table class="head3"
						style="width:auto; white-space: nowrap; border-spacing: 0px">
						<tr style="background: #f2f2f2; height: 30px; line-height: 20px;"
							class="sel">
							<td style="width: 20px"></td>
							<td>员工编号</td>
							<td>员工姓名</td>
							<td>部门</td>
							<td>员工类型</td>
							<td>身份证号码</td>
							<td>手机号码</td>
							<td>地址</td>
							<td>出生日期</td>
							<td>入职日期</td>
							<td>转正日期</td>
							<td>离职日期</td>
							<td>合同到期日</td>
							<td>社保编号</td>
							<td>车辆</td>
							<td>性别</td>
							<td>职级职等</td>
							<td>薪酬调整</td>
							<td>岗位异动</td>
							<td>请假记录</td>
							<td>违纪奖励记录</td>
							<td>社会保险记录</td>
							<td>计算招生提成</td>
							<td>计算培训提成</td>
						</tr>
						<c:forEach items="${persons}" var="persons" varStatus="s">
							<tr style="margin-top: 45px" class="jx">
								<td><input type="checkbox" class="check"
									value="${persons.fid}" name="person" /></td>
								<td>${persons.fnumber}</td>
								<td>${persons.fnameL2}</td>
								<td>${persons.cfpersondepName}</td>
								<c:if test="${empty persons.cfpersontype}">
									<td></td>
								</c:if>
								<c:if test="${persons.cfpersontype == '0'}">
									<td></td>
								</c:if>
								<c:if test="${persons.cfpersontype == '1'}">
									<td>办公室职员</td>
								</c:if>
								<c:if test="${persons.cfpersontype == '2'}">
									<td>教练</td>
								</c:if>
								<c:if test="${persons.cfpersontype == '3'}">
									<td>其他</td>
								</c:if>
								<td>${persons.cfidcardno}</td>
								<td>${persons.cfcell}</td>
								<td>${persons.cfaddress}</td>
								<td>${persons.cfbirthdays}</td>
								<td>${persons.cfbegindate}</td>
								<td>${persons.cfstartdate}</td>
								<td>${persons.cfenddate}</td>
								<td>${persons.cfhtdqsj}</td>
								<td>${persons.cfaccountsno}</td>
								<td>${persons.cfcarName}</td>
								<c:if test="${empty persons.cfsex}">
									<td></td>
								</c:if>
								<c:if test="${persons.cfsex == '1'}">
									<td>男</td>
								</c:if>
								<c:if test="${persons.cfsex == '2'}">
									<td>女</td>
								</c:if>
								<td>${persons.positiongradeName}</td>
								<td>${persons.cfxctz}</td>
								<td>${persons.cfgwyd}</td>
								<td>${persons.cfqjjl}</td>
								<td>${persons.cfwjjljl}</td>
								<td>${persons.cfshjljl}</td>
								<c:if test="${empty persons.cfzstc}">
									<td><input type="checkbox" disabled="disabled"></td>
								</c:if>
								<c:if test="${persons.cfzstc == '0'}">
									<td><input type="checkbox" disabled="disabled"></td>
								</c:if>
								<c:if test="${persons.cfzstc == '1'}">
									<td><input type="checkbox" disabled="disabled"
										checked="checked"></td>
								</c:if>
								<c:if test="${empty persons.cfpxtc}">
									<td><input type="checkbox" disabled="disabled"></td>
								</c:if>
								<c:if test="${persons.cfpxtc == '0'}">
									<td><input type="checkbox" disabled="disabled"></td>
								</c:if>
								<c:if test="${persons.cfpxtc == '1'}">
									<td><input type="checkbox" disabled="disabled"
										checked="checked"></td>
								</c:if>
							</tr>
						</c:forEach>
					</table>

					<input type="hidden" class="type">
				</form>
			</div>
			<button class="subtn3"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; left: 170px">
				确定</button>
			<button class="btn"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; right: 170px">
				关闭</button>
		</div>

		<div class="modal-data4" >
				<div style="height: 60px">
				 <ul>
				  	<li  style="text-align: left;margin-left: 60px;height: 40px;line-height: 40px">
				  		<span>名称：</span>
				  		<span>
				  		 	<input class="name4" type="text" >
				  		</span>
				  		<span>
				  			<button class="findBtn4" >
				  				查询
				  			</button>
				  		</span>
				  	</li>
				 </ul>
				</div>
				<div style="width:1000px; height:350px; overflow:scroll;">
			      <form action="">
			        <table class="head4"  style="width: auto;white-space:nowrap;border-spacing:0px">
			        <tr style="background: #f2f2f2;height: 30px;line-height: 20px;" class="sel">
			        <td style="width: 20px"></td>
			        <td>
			        	名称
			        </td>
			        <td>
			        	编码
			        </td>
			        <td>
			        	简称
			        </td>
			        <td>
			        	描述
			        </td>
			        <td>
			        	创建时间
			        </td>
			        <td>
			        	用户名
			        </td>
			        <td>
			        	别名
			        </td>
			        <td>
			        	最后修改时间
			        </td>
			        <td>
			        	财务组织
			        </td>
			        <td>科目</td>
			        <td>队长</td>
			        </tr>
			        <c:forEach items="${teams }" var="team">
			        	<tr class="coachteam">
			        		<td><input style="width: 20px;" type="checkbox" class="check" name="team" value="${team.fid }"/></td>
			        		<td>${team.fnameL2 }</td>
			        		<td>${team.fnumber }</td>
			        		<td>${team.fsimplename }</td>
			        		<td>${team.fdescriptionL2 }</td>
			        		<td>${team.fcreatetime }</td>
			        		<td>${team.createName }</td>
			        		<td>${team.createName }</td>
			        		<td>${team.flastupdatetime }</td>
			        		<td>${team.companyName }</td>
			        		<c:if test="${team.cfkemu  eq 1}">
			        			<td>科目一</td>
			        		</c:if>
			        		<c:if test="${team.cfkemu  eq 2}">
			        			<td>科目二</td>
			        		</c:if>
			        		<c:if test="${team.cfkemu  eq 3}">
			        			<td>科目三</td>
			        		</c:if>
			        		<c:if test="${team.cfkemu  eq 4}">
			        			<td>科目四</td>
			        		</c:if>
			        		<td>${team.teamName }</td>
			        	</tr>
			        </c:forEach>
			        </table>
			      </form>
                    <button class="subtn4"
                            style="width: 150px;position: absolute;bottom: 25px;font-size: 16px;left: 280px">
			      	确定
			      </button>
                    <button class="btn"
                            style="width: 150px;position: absolute;bottom: 25px;font-size: 16px;right: 280px">
			      	关闭
			      </button>
			     </div>
			</div>
 	<div class="modal-data6">
			<div style="height: 60px">
				<ul>
					<li
						style="text-align: left; margin-left: 60px; height: 40px; line-height: 40px">
						<span>名称：</span> <span> <input class="name6" type="text">
					</span> <span>
							<button class="findBtn6">查询</button>
					</span>
					</li>
				</ul>
			</div>
			<div style="width: 1100px; height: 350px; overflow: scroll;">
				<form action="">
					<table class="head6"
						style="width: auto; white-space: nowrap; border-spacing: 0px">
						<tr style="background: #f2f2f2; height: 30px; line-height: 20px;"
							class="sel">
							<td style="width: 20px"></td>
							<td width="100px">名称</td>
							<td width="100px">编码</td>
							<td width="100px">简称</td>
							<td width="100px">描述</td>
							<td width="150px">创建时间</td>
							<td width="100px">用户名</td>
							<td width="150px">最后修改时间</td>
							<td width="100px">用户名</td>
						</tr>
						<c:forEach items="${oilspecs}" var="s">
						<tr style="margin-top: 45px" class="oilspec">
						<td><input type="checkbox" class="check" value="${s.fid}" name="oilspec" /></td>
							<td>${s.fnameL2}</td>
							<td>${s.fnumber}</td>
							<td>${s.fsimplename}</td>
							<td>${s.fdescriptionL2}</td>
							<td>${s.fcreatetime}</td>
							<td>${s.createName}</td>
							<td>${s.flastupdatetime}</td>
							<td>${s.updateName}</td>
						</tr>
						</c:forEach>
					</table>
				</form>
			</div>
			<button class="subtn6"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; left: 170px">
				确定</button>
			<button class="btn"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; right: 170px">
				关闭</button>
			</div>
	<div class="div_body" style="box-shadow: 0 0 5px #cccccc;height: 950px">
	<c:if test="${carRefuel.cfbillstate eq 3 }">
			<div class="div_form">
				<form  id="update_carRefuel" action="<%=path%>/DrivingSys/updateCarRefuel" class="form" onsubmit="return subForm()">
				<input type="hidden" name="fid" value="${carRefuel.fid }">
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">驾校&nbsp;:&nbsp;</span>
								<input  type="text" name=""  value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
								<input  type="text" id="fnumber" name="fnumber" value="${carRefuel.fnumber}" style="color: gray;" readonly="readonly"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
								<input  type="text" name="fbizdate"  id="ywrq" value="${carRefuel.fbizdate}"
								onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
								<img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"
					            src="<%=path%>/image/date.jpg"  align="absmiddle" style="padding-left: 15px">
							</div>
						</div>
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">备注&nbsp;:&nbsp;</span>
								<input name="fdescription" value="${carRefuel.fdescription}"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">加油员&nbsp;:&nbsp;</span>
								<input type="text" class="cfjypersonName is_click" name="cfjypersonName" value="${carRefuel.cfjypersonName}"/>
								<input type="hidden" name="cfjypersonid" class="cfjypersonid" value="${carRefuel.cfjypersonid}">
							</div>
							<div class="input_hang">
								<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
								<select name="cfbillstate" >
									<option id="shenhe" style="color: gray;" value="3">保存</option>
								</select>
							</div>
					</div>

					<div class="div_zilei">
							<div style="width: 93%;text-align: right;">
								<img src="<%=path%>/image/insert2323.jpg" class="addTable">
								<span style="padding-right: 20px;color: #57a0ff;font-weight:700;font-size: 14px" class="addTable">添加</span>
								<img src="<%=path%>/image/delete212.png" class="deleteTable">
								<span class="deleteTable" style="color: #57a0ff;font-weight:700;font-size: 14px;" class="deleteTable">删除</span>
							</div>
					</div>
					<input type="hidden" class="stu">
					<div style="min-height: 500px;width: 88%;padding-left: 90px;">
					<div style="overflow:scroll;height: 500px;width: 100%">
							<table  width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
									<tr class="tr">
										<td  width="20px"><%--<input type="checkbox" name="" class="check">--%></td>
										<td  width="40px">序号</td>
										<td align="center">车号</td>
										<td align="center">车型</td>
										<td align="center">部门</td>
										<td align="center">教练员</td>
										<td align="center">教练队</td>
										<td align="center">教练组</td>
										<td align="center">科目</td>
										<td align="center">油规格</td>
										<td align="center">加油量(公升)</td>
										<td align="center">备注</td>
									</tr>
									<c:forEach items="${carRefuel.carRefuelEntryList}" var="carRefuelEntry">
									<tr style="margin-top: 45px" class="">
										<td align="right" width="40px"><input type="checkbox"
											name="check2" style="width: 15px"></td>
										<td><input type="text" name="fseq" class="fseq" value="${carRefuelEntry.fseq }"
											readonly unselectable="on"
											style="width: 40px; border: none; color: #cccccc; text-align: center;"></td>
										<td><input type="text" name="carfnumber" value="${carRefuelEntry.carFnumber }"
											class="is_click" onclick="changcar($(this))"><input type="hidden"
											name="carId" value="${carRefuelEntry.cfcarnoid }"></td>
										<td><input type="text" name="cfcartype" value="${carRefuelEntry.cfcartype }"
											readonly="readonly"></td>
										<td><input type="text" name="cfdepname" value="${carRefuelEntry.cfdepname }"
											readonly="readonly"></td>
										<td><input type="text" name="cftrainName" value="${carRefuelEntry.cftrainName }"
											class="is_click" onclick="changtrain($(this))"><input type="hidden"
											name="cftrainid" value="${carRefuelEntry.cftrainid }"></td>
										<td><input type="text" name="cfteamName" value="${carRefuelEntry.cfteamName }"
											class="is_click_ne" onclick="changteam($(this))"><input type="hidden"
											name="cfteamid" value="${carRefuelEntry.cfteamcoach }"></td>
										<td><input type="text" name="cfgroupName" value="${carRefuelEntry.cfgroupName }"
											class="is_click_ne" onclick="changgroup($(this))"><input type="hidden"
											name="cfgroupid" value="${carRefuelEntry.cfgroupid }"></td>
										<td><select name="cfkemu">
												<c:if test="${carRefuelEntry.cfkemu eq 0 }">
													<option value="0" selected="selected"></option>
													<option value="1">科目一</option>
													<option value="2">科目二</option>
													<option value="3">科目三</option>
													<option value="4">备用车</option>
												</c:if>
												<c:if test="${carRefuelEntry.cfkemu eq 1 }">
													<option value="0" ></option>
													<option value="1" selected="selected">科目一</option>
													<option value="2">科目二</option>
													<option value="3">科目三</option>
													<option value="4">备用车</option>
												</c:if>
												<c:if test="${carRefuelEntry.cfkemu eq 2 }">
													<option value="0" ></option>
													<option value="1">科目一</option>
													<option value="2" selected="selected">科目二</option>
													<option value="3">科目三</option>
													<option value="4">备用车</option>
												</c:if>
												<c:if test="${carRefuelEntry.cfkemu eq 3 }">
													<option value="0" ></option>
													<option value="1">科目一</option>
													<option value="2">科目二</option>
													<option value="3" selected="selected">科目三</option>
													<option value="4">备用车</option>
												</c:if>
												<c:if test="${carRefuelEntry.cfkemu eq 4 }">
													<option value="0" ></option>
													<option value="1">科目一</option>
													<option value="2">科目二</option>
													<option value="3">科目三</option>
													<option value="4" selected="selected">备用车</option>
												</c:if>
											</select>
										</td>
										<td><input type="text" name="cfoilspecName" value="${carRefuelEntry.cfoilspecName }"
											class="cfoilspecName is_click" onclick="changoilspec2($(this))"><input
											type="hidden" name="cfoilspecid" value="${carRefuelEntry.cfoilspecid }"></td>
										<td><input type="text" name="cfqty" value="${carRefuelEntry.cfqty}"
											class="cfqty" onblur="countqty2($(this))"><input
											type="hidden" value=""></td>
										<td><input type="text" name="cfdesc" value="${carRefuelEntry.cfdesc}"></td>
									</tr>
								</c:forEach>
							</table>

							<table align="center" id="table2" style="height:45px;overflow:scroll;border-spacing:0;display: none;margin-top: 100px;">
								<tr>
									<td width="55px" colspan="2">
										<input type="text" readonly="readonly" value="合计"  style="width: 60px;color: #cccccc;text-align: center;">
									</td>
									<!-- <td></td> -->
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" value=""  readonly="readonly"  ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" value="0" readonly="readonly"  id="cfqty"></td>
									<td><input type="text" value="" ></td>
								</tr>
							</table>
						</div>
					</div>


					 <div class="div_input_hang" style="margin-top: 50px">
							<div class="input_hang">
								<span class="gn_name">审核人&nbsp;:&nbsp;</span>
								<input name="fhandlerid" readonly="readonly" style="color: gray;" type="text"  value="${carRefuel.checkName}"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建者&nbsp;:&nbsp;</span>
								<input name="createName" readonly readonly="readonly" value="${carRefuel.createName}" style="color: gray;" type="text"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
								<input name="fcreatetime" style="color: gray;" readonly="readonly" type="text" value="${carRefuel.fcreatetime}"/>
							</div>
					</div>

					<div class="div_tj" style="padding-top: 0px">
						<shiro:hasPermission name="/sureCarRefuel">
							<div>
                                <input class="input_submit bc" value="" type="submit">
							</div>
						</shiro:hasPermission>

						<shiro:hasPermission name="/submitCarRefuel">
							<div>
								<input type="button" class="input_submit tj" value=""  onclick="audit(4)"/>
							</div>
						</shiro:hasPermission>
						<div>
							<input type="button" class="input_submit cklc" value="" onclick="lookActivitiImg('publicProcess',$('#fnumber').val())">
						</div>
						<div>
							<input type="button" class="input_back fh"  value="" onclick="back()"/>
						</div>
					</div>
				</form>
			</div>
			</c:if>

		<c:if test="${carRefuel.cfbillstate eq 4 }">
			<div class="div_form">
				<form  id="update_carRefuel" action="<%=path%>/DrivingSys/updateCarRefuel" class="form">
					<input type="hidden" name="fid" value="${carRefuel.fid }">
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">驾校&nbsp;:&nbsp;</span>
							<input  type="text" name=""  value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
							<input  type="text" id="fnumber" name="fnumber" value="${carRefuel.fnumber}" style="color: gray;" readonly="readonly"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
							<input  type="text" name="fbizdate"  id="ywrq" value="${carRefuel.fbizdate}"
									onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})" readonly="readonly"/>
							<img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"
								 src="<%=path%>/image/date.jpg"  align="absmiddle" style="padding-left: 15px">
						</div>
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">备注&nbsp;:&nbsp;</span>
							<input name="fdescription" value="${carRefuel.fdescription}" readonly="readonly"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">加油员&nbsp;:&nbsp;</span>
							<input type="text" <%--class="cfjypersonName"--%> name="cfjypersonName" value="${carRefuel.cfjypersonName}" readonly="readonly"/>
							<input type="hidden" name="cfjypersonid" class="cfjypersonid" value="${carRefuel.cfjypersonid}">
						</div>
						<div class="input_hang">
							<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
							<select name="cfbillstate" >
								<option id="shenhe" style="color: gray;" value="4">提交</option>
							</select>
						</div>
					</div>

					<div class="div_zilei">
						<div style="width: 88%;text-align: right;">
							<%--<img src="<%=path%>/image/insert2323.jpg" class="addTable">
							<span style="padding-right: 20px;color: #a9bbe0;font-size: 14px" class="addTable">添加</span>
							<img src="<%=path%>/image/delete212.png" class="deleteTable">
							<span class="deleteTable" style="color: #a9bbe0;font-size: 14px;" class="deleteTable">删除</span>--%>
						</div>
					</div>
					<input type="hidden" class="stu">
					<div style="min-height: 500px;width: 88%;padding-left: 90px;">
						<div style="overflow:scroll;height: 500px;width: 100%">
							<table  width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
								<tr class="tr">
									<td  width="20px"><input type="checkbox" name="" class="check"></td>
									<td  width="40px">序号</td>
									<td align="center">车号</td>
									<td align="center">车型</td>
									<td align="center">部门</td>
									<td align="center">教练员</td>
									<td align="center">教练队</td>
									<td align="center">教练组</td>
									<td align="center">科目</td>
									<td align="center">油规格</td>
									<td align="center">加油量(公升)</td>
									<td align="center">备注</td>
								</tr>
								<c:forEach items="${carRefuel.carRefuelEntryList}" var="carRefuelEntry">
									<tr style="margin-top: 45px" class="">
										<td align="right" width="40px"><input type="checkbox"
																			  name="check2" style="width: 15px"></td>
										<td><input type="text" name="fseq" class="fseq" value="${carRefuelEntry.fseq }"
												   readonly unselectable="on"
												   style="width: 40px; border: none; color: #cccccc; text-align: center;" readonly="readonly"/></td>
										<td><input type="text" name="carfnumber" value="${carRefuelEntry.carFnumber }"
												   readonly="readonly"/><input type="hidden"
																					  name="carId" value="${carRefuelEntry.cfcarnoid }" readonly="readonly"/></td>
										<td><input type="text" name="cfcartype" value="${carRefuelEntry.cfcartype }"
												   readonly="readonly"/></td>
										<td><input type="text" name="cfdepname" value="${carRefuelEntry.cfdepname }"
												   readonly="readonly"/></td>
										<td><input type="text" name="cftrainName" value="${carRefuelEntry.cftrainName }"
												    readonly="readonly"/><input type="hidden"
																						name="cftrainid" value="${carRefuelEntry.cftrainid }" readonly="readonly"/></td>
										<td><input type="text" name="cfteamName" value="${carRefuelEntry.cfteamName }"
												    readonly="readonly"/><input type="hidden"
																					   name="cfteamid" value="${carRefuelEntry.cfteamcoach }" readonly="readonly"/></td>
										<td><input type="text" name="cfgroupName" value="${carRefuelEntry.cfgroupName }"
												   readonly="readonly"/><input type="hidden"
																						name="cfgroupid" value="${carRefuelEntry.cfgroupid }" readonly="readonly"/></td>
										<td><select name="cfkemu" readonly="readonly" >
											<c:if test="${carRefuelEntry.cfkemu eq 0 }">
												<option value="0" selected="selected"></option>
												<option value="1">科目一</option>
												<option value="2">科目二</option>
												<option value="3">科目三</option>
												<option value="4">备用车</option>
											</c:if>
											<c:if test="${carRefuelEntry.cfkemu eq 1 }">
												<option value="" ></option>
												<option value="1" selected="selected">科目一</option>
												<option value="2">科目二</option>
												<option value="3">科目三</option>
												<option value="4">备用车</option>
											</c:if>
											<c:if test="${carRefuelEntry.cfkemu eq 2 }">
												<option value="" ></option>
												<option value="1">科目一</option>
												<option value="2" selected="selected">科目二</option>
												<option value="3">科目三</option>
												<option value="4">备用车</option>
											</c:if>
											<c:if test="${carRefuelEntry.cfkemu eq 3 }">
												<option value="" ></option>
												<option value="1">科目一</option>
												<option value="2">科目二</option>
												<option value="3" selected="selected">科目三</option>
												<option value="4">备用车</option>
											</c:if>
											<c:if test="${carRefuelEntry.cfkemu eq 4 }">
												<option value="" ></option>
												<option value="1">科目一</option>
												<option value="2">科目二</option>
												<option value="3">科目三</option>
												<option value="4" selected="selected">备用车</option>
											</c:if>
										</select>
										</td>
										<td><input type="text" name="cfoilspecName" value="${carRefuelEntry.cfoilspecName }"
												   class="cfoilspecName" readonly="readonly"/><input
												type="hidden" name="cfoilspecid" value="${carRefuelEntry.cfoilspecid }" readonly="readonly"/></td>
										<td><input type="text" name="cfqty" value="${carRefuelEntry.cfqty}"
												   class="cfqty" onblur="countqty2($(this))" readonly="readonly"/><input
												type="hidden" value=""></td>
										<td><input type="text" name="cfdesc" value="${carRefuelEntry.cfdesc}" readonly="readonly"/></td>
									</tr>
								</c:forEach>
							</table>

							<table align="center" id="table2" style="height:45px;overflow:scroll;border-spacing:0;display: none;margin-top: 100px;">
								<tr>
									<td width="55px" colspan="2">
										<input type="text" readonly="readonly" value="合计"  style="width: 60px;color: #cccccc;text-align: center;">
									</td>
									<!-- <td></td> -->
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" value=""  readonly="readonly"  ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" value="0" readonly="readonly"  id="cfqty"></td>
									<td><input type="text" value="" ></td>
								</tr>
							</table>
						</div>
					</div>


					<div class="div_input_hang" style="margin-top: 50px">
						<div class="input_hang">
							<span class="gn_name">审核人&nbsp;:&nbsp;</span>
							<input name="fhandlerid" readonly="readonly" style="color: gray;" type="text"  value="${carRefuel.checkName}"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">创建者&nbsp;:&nbsp;</span>
							<input name="createName" readonly readonly="readonly" value="${carRefuel.createName}" style="color: gray;" type="text"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
							<input name="fcreatetime" style="color: gray;" readonly="readonly" type="text" value="${carRefuel.fcreatetime}"/>
						</div>
					</div>

					<div class="div_tj" style="padding-top: 0px">
						<shiro:hasPermission name="/auditCarRefuel">
							<div>
								<input type="button" class="input_submit sh" value=""  onclick="audit(5)"/>
							</div>
						</shiro:hasPermission>
						<shiro:hasPermission name="/againstAuditCarRefuel">
							<div>
								<input  class="input_submit fsh" value="" type="button" onclick="audit(3)">
							</div>
						</shiro:hasPermission>
						<div>
							<input type="button" class="input_submit cklc" value="" onclick="lookActivitiImg('publicProcess',$('#fnumber').val())">
						</div>
						<div>
							<input type="button" class="input_back fh"  value="" onclick="back()"/>
						</div>
					</div>
				</form>
			</div>
		</c:if>


			<c:if test="${carRefuel.cfbillstate eq 5 }">
			<div class="div_form">
				<form  id="update_carRefuel" action="<%=path%>/DrivingSys/updateCarRefuel" class="form">
				<input type="hidden" name="fid" value="${carRefuel.fid }">
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">驾校&nbsp;:&nbsp;</span>
								<input  type="text" name=""  value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
								<input  type="text" id="fnumber" name="fnumber" value="${carRefuel.fnumber}" style="color: gray;" disabled="disabled" readonly="readonly"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
								<input  type="text" name="fbizdate"  id="ywrq" value="${carRefuel.fbizdate}"  disabled="disabled"
								onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
								<img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"
					            src="<%=path%>/image/date.jpg"  align="absmiddle" style="padding-left: 15px">
							</div>
						</div>
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">备注&nbsp;:&nbsp;</span>
								<input name="fdescription" value="${carRefuel.fdescription}" disabled="disabled"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">加油员&nbsp;:&nbsp;</span>
								<input type="text" class="cfjypersonName" name="cfjypersonName" value="${carRefuel.cfjypersonName}" disabled="disabled"/>
								<input type="hidden" name="cfjypersonid" class="cfjypersonid" value="${carRefuel.cfjypersonid}">
							</div>
							<div class="input_hang">
								<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
								<select  name="cfbillstate" >
									<option id="shenhe" style="color: gray;" value="5">审核</option>
								</select>
							</div>
					</div>

					<div class="div_zilei">
							<div style="width: 88%;text-align: right;">
								<%--<img src="<%=path%>/image/insert2323.jpg" class="addTable">
								<span style="padding-right: 20px;color: #a9bbe0;font-size: 14px" class="addTable" >添加</span>
								<img src="<%=path%>/image/delete212.png" class="deleteTable">
								<span class="deleteTable" style="color: #a9bbe0;font-size: 14px;" class="deleteTable">删除</span>--%>
							</div>
					</div>
					<input type="hidden" class="stu">
					<div style="min-height: 500px;width: 88%;padding-left: 90px;">
					<div style="overflow:scroll;height: 500px;width: 100%">
							<table  width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
									<tr class="tr">
										<td  width="20px"><input type="checkbox" name="" class="check"></td>
										<td  width="40px">序号</td>
										<td align="center">车号</td>
										<td align="center">车型</td>
										<td align="center">部门</td>
										<td align="center">教练员</td>
										<td align="center">教练队</td>
										<td align="center">教练组</td>
										<td align="center">科目</td>
										<td align="center">油规格</td>
										<td align="center">加油量(公升)</td>
										<td align="center">备注</td>
									</tr>
									<c:forEach items="${carRefuel.carRefuelEntryList}" var="carRefuelEntry">
									<tr style="margin-top: 45px" class="">
										<td align="right" width="40px"><input type="checkbox"
											name="check2" style="width: 15px"></td>
										<td><input type="text" name="fseq" class="fseq" value="${carRefuelEntry.fseq }"
											readonly unselectable="on"
											style="width: 40px; border: none; color: #cccccc; text-align: center;" readonly="readonly"/></td>
										<td><input type="text" name="carfnumber" value="${carRefuelEntry.carFnumber }"
											 readonly="readonly"/><input type="hidden"
											name="carId" value="${carRefuelEntry.cfcarnoid }"></td>
										<td><input type="text" name="cfcartype" value="${carRefuelEntry.cfcartype }"
											readonly="readonly"></td>
										<td><input type="text" name="cfdepname" value="${carRefuelEntry.cfdepname }"
											readonly="readonly"></td>
										<td><input type="text" name="cftrainName" value="${carRefuelEntry.cftrainName }"
											 readonly="readonly"><input type="hidden"
											name="cftrainid" value="${carRefuelEntry.cftrainid }"></td>
										<td><input type="text" name="cfteamName" value="${carRefuelEntry.cfteamName }"
											 readonly="readonly"><input type="hidden"
											name="cfteamid" value="${carRefuelEntry.cfteamcoach }"></td>
										<td><input type="text" name="cfgroupName" value="${carRefuelEntry.cfgroupName }"
											readonly="readonly"><input type="hidden"
											name="cfgroupid" value="${carRefuelEntry.cfgroupid }" readonly="readonly"/></td>
										<td><select name="cfkemu" >
												<c:if test="${carRefuelEntry.cfkemu eq 0 }">
													<option value="0" selected="selected"></option>
													<option value="1">科目一</option>
													<option value="2">科目二</option>
													<option value="3">科目三</option>
													<option value="4">备用车</option>
												</c:if>
												<c:if test="${carRefuelEntry.cfkemu eq 1 }">
													<option value="" ></option>
													<option value="1" selected="selected">科目一</option>
													<option value="2">科目二</option>
													<option value="3">科目三</option>
													<option value="4">备用车</option>
												</c:if>
												<c:if test="${carRefuelEntry.cfkemu eq 2 }">
													<option value="" ></option>
													<option value="1">科目一</option>
													<option value="2" selected="selected">科目二</option>
													<option value="3">科目三</option>
													<option value="4">备用车</option>
												</c:if>
												<c:if test="${carRefuelEntry.cfkemu eq 3 }">
													<option value="" ></option>
													<option value="1">科目一</option>
													<option value="2">科目二</option>
													<option value="3" selected="selected">科目三</option>
													<option value="4">备用车</option>
												</c:if>
												<c:if test="${carRefuelEntry.cfkemu eq 4 }">
													<option value="" ></option>
													<option value="1">科目一</option>
													<option value="2">科目二</option>
													<option value="3">科目三</option>
													<option value="4" selected="selected">备用车</option>
												</c:if>
											</select>
										</td>
										<td><input type="text" name="cfoilspecName" value="${carRefuelEntry.cfoilspecName }"
											class="cfoilspecName"  readonly="readonly"/><input
											type="hidden" name="cfoilspecid" value="${carRefuelEntry.cfoilspecid }" readonly="readonly"/></td>
										<td><input type="text" name="cfqty" value="${carRefuelEntry.cfqty}"
											class="cfqty" onblur="countqty2($(this))" readonly="readonly"/><input
											type="hidden" value=""></td>
										<td><input type="text" name="cfdesc" value="${carRefuelEntry.cfdesc}" readonly="readonly"/></td>
									</tr>
								</c:forEach>
							</table>

							<table align="center" id="table2" style="height:45px;overflow:scroll;border-spacing:0;display: none;margin-top: 100px;">
								<tr>
									<td width="55px" colspan="2">
										<input type="text" readonly="readonly" value="合计"  style="width: 60px;color: #cccccc;text-align: center;">
									</td>
									<!-- <td></td> -->
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" value=""  readonly="readonly"  ></td>
									<td><input type="text" readonly="readonly" ></td>
									<td><input type="text" value="0" readonly="readonly"  id="cfqty"></td>
									<td><input type="text" value="" ></td>
								</tr>
							</table>
						</div>
					</div>


					 <div class="div_input_hang" style="margin-top: 50px">
							<div class="input_hang">
								<span class="gn_name">审核人&nbsp;:&nbsp;</span>
								<input name="fhandlerid" readonly="readonly" style="color: gray;" type="text"  value="${carRefuel.checkName}" disabled="disabled"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建者&nbsp;:&nbsp;</span>
								<input name="createName" readonly readonly="readonly" value="${carRefuel.createName}" style="color: gray;" type="text" disabled="disabled"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
								<input name="fcreatetime" style="color: gray;" readonly="readonly" type="text" value="${carRefuel.fcreatetime}" disabled="disabled"/>
							</div>
					</div>

					<div class="div_tj" style="padding-top: 0px">
						<shiro:hasPermission name="/againstAuditCarRefuel">
							<div>
								<input type="button" class="input_submit fsh" value=""  onclick="audit(3)"/>
							</div>
						</shiro:hasPermission>
						<div>
							<input type="button" class="input_submit cklc" value="" onclick="lookActivitiImg('publicProcess',$('#fnumber').val())">
						</div>
						<div>
                            <input type="button" class="input_back fh" value="" onclick="back()"/>
						</div>
					</div>
				</form>
			</div>
			</c:if>
	</div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp" %>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#table2").show()
	cfqty();//算总数量
})
//弹出加油员摸态框
$(".cfjypersonName").click(function(){
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data3').css('visibility','visible')
	$('input:checkbox').removeAttr('checked');
})
//关闭摸态框
$(".btn").click(function(){
	$('#modal-overlay').css('visibility','hidden')
	$('.modal-data1').css('visibility','hidden')
	$('.modal-data2').css('visibility','hidden')
	$('.modal-data3').css('visibility','hidden')
	$('.modal-data4').css('visibility','hidden')
	$('.modal-data5').css('visibility','hidden')
	$('.modal-data6').css('visibility','hidden')
	$('input:checkbox').removeAttr('checked');
})
  //单击职员
 $(".jx td").live('click',function(){
    $('input:checkbox[name=person]:checked').each(function(i) {
    	$(this).removeAttr("checked");
     });
       $(this).parent().find("input:checkbox").attr('checked','checked');
  })
//双击确定职员数据
$(document).on('dblclick','.jx td',function(){
	 var fid;//fid
 	 var name;//名称
		 $('input:checkbox[name=person]:checked').each(function (i) {
			  if (0 == i) {
				 fid = $(this).val();
	        	 name = $(this).parent().next().next().text();
			   }
		 });
		 if(trainName != null ){
	 		 trainName.val(name)
	 		 trainName.next().val(fid);
	 		 trainName = null;//清空教练对象
	 		 $('#modal-overlay').css('visibility','hidden')
	 		 $('.modal-data3').css('visibility','hidden')
	 	 }else{
	 		 personData(fid,name);
	 	 }
})
//确定按钮把数据填入
$(".subtn3").click(function(){
	 var fid;//fid
 	 var name;//名称
		 $('input:checkbox[name=person]:checked').each(function (i) {
			  if (0 == i) {
				 fid = $(this).val();
	        	 name = $(this).parent().next().next().text();
			   }
		 });
 	 if(fid == null ){
 		 alert("请勾选需要选中的行！")
 		 return false;
 	 }
 	 if(trainName != null ){
 		 trainName.val(name)
 		 trainName.next().val(fid);
 		 trainName = null;//清空教练对象
 		 $('#modal-overlay').css('visibility','hidden')
 		 $('.modal-data3').css('visibility','hidden')
 	 }else{
 		 personData(fid,name);
 	 }

})
//放入职员数据
function personData(fid,name){
	 $(".cfjypersonName").val(name);
	 $(".cfjypersonName").next().val(fid);
	 $('#modal-overlay').css('visibility','hidden')
	 $('.modal-data3').css('visibility','hidden')
}
//根据姓名查询加油人员
$(".findBtn3").click(function(){
	var name = $(".name3").val();
	$.ajax({
		url:'<%=path%>/DrivingSys/quePersonByName',
	    type: "post",
	    data:{'name':name},
	    dataType:"json",
	    success:function(json){
	    	var str = '';
	    	for (var i = 0; i < json.length; i++) {
	    		str += '<tr style="margin-top: 45px;height: 30px;" class="jx"><td><input style="width: 15px;height: 15px" '
		  	         str+='type="checkbox" name="person"  value="'+json[i].fid+'"></td>'
					if (json[i].fnumber == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].fnumber + '</td>'
					}
					if (json[i].fnameL2 == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].fnameL2 + '</td>'
					}
					if (json[i].cfpersondepName == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfpersondepName + '</td>'
					}
					if (json[i].cfpersontype == '1') {
						str += '<td>办公室职员</td>'
					} else if (json[i].cfpersontype == '2') {
						str += '<td>教练</td>'
					} else if (json[i].cfpersontype == '3') {
						str += '<td>其他</td>'
					} else {
						str += '<td></td>'
					}
					if (json[i].cfidcardno == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfidcardno + '</td>'
					}
					if (json[i].cfcell == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfcell + '</td>'
					}
					if (json[i].cfaddress == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfaddress + '</td>'
					}
					if (json[i].cfbirthdays == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfbirthdays + '</td>'
					}
					if (json[i].cfbegindate == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfbegindate + '</td>'
					}
					if (json[i].cfstartdate == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfstartdate + '</td>'
					}
					if (json[i].cfenddate == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfenddate + '</td>'
					}
					if (json[i].cfhtdqsj == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfhtdqsj + '</td>'
					}
					if (json[i].cfhtdqsj == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfaccountsno + '</td>'
					}
					if (json[i].cfcarName == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfcarName + '</td>'
					}
					if (json[i].cfsex == '1') {
						str += '<td>男</td>'
					} else if (json[i].cfsex == '2') {
						str += '<td>女</td>'
					} else {
						str += '<td></td>'
					}
					if (json[i].positiongradeName == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].positiongradeName + '</td>'
					}
					if (json[i].cfxctz == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfxctz + '</td>'
					}
					if (json[i].cfgwyd == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfgwyd + '</td>'
					}
					if (json[i].cfqjjl == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfqjjl + '</td>'
					}
					if (json[i].cfwjjljl == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfwjjljl + '</td>'
					}
					if (json[i].cfshjljl == null) {
						str += '<td></td>'
					} else {
						str += '<td>' + json[i].cfshjljl + '</td>'
					}
					if (json[i].cfzstc == '0') {
						str += '<td><input type="checkbox" disabled="disabled"></td>'
					} else if (json[i].cfzstc == '1') {
						str += '<td><input type="checkbox" disabled="disabled" checked="checked"></td>'
					} else {
						str += '<td><input type="checkbox" disabled="disabled"></td>'
					}
					if (json[i].cfpxtc == '1') {
						str += '<td><input type="checkbox" disabled="disabled" checked="checked"></td>'
					} else {
						str += '<td><input type="checkbox" disabled="disabled"></td>'
					}
					str += '</tr>';
	    	}
	    	$(".head3 tr:not(':first')").remove();
			$('.head3').append(str)
	   },
			error: function(){alert('错误！！！');}
	})
})

//增加一行
$(".addTable").click(function(){
	addTableTr()
	$("#table2").show();
})
function addTableTr(){
    var str = '';
    str+='<tr style="margin-top: 45px" class="">'
    str+='<td align="right" width="40px"><input type="checkbox" name="check2" style="width:15px"></td>'
    str+='<td><input type="text" name="fseq" class="fseq" value=""  readonly unselectable="on" style="width:40px;border:none;color:#cccccc;text-align: center;"></td>'
    str+='<td><input type="text" name="carfnumber" value="" class="is_click" onclick="changcar($(this))"><input type="hidden" name="carId" value=""></td>'
    str+='<td><input type="text" name="cfcartype" value=""  readonly="readonly" ></td>'
    str+='<td><input type="text" name="cfdepname" value=""  readonly="readonly" ></td>'
    str+='<td><input type="text" id="cftrainName" name="cftrainName" value="" class="is_click" onclick="changtrain($(this))"><input type="hidden" id="cftrainid" name="cftrainid" value=""></td>'
    str+='<td><input type="text" name="cfteamName" value="" class="is_click_ne" onclick="changteam($(this))"><input type="hidden" name="cfteamid" value=""></td>'
    str+='<td><input type="text" name="cfgroupName" value="" class="is_click_ne" onclick="changgroup($(this))"><input type="hidden" name="cfgroupid" value=""></td>'
    str+='<td><select name="cfkemu"><option value=""></option><option value="1">科目一</option><option selected=selected value="2">科目二</option><option value="3">科目三</option><option value="4">备用车</option></select></td>'
    str+='<td><input type="text" name="cfoilspecName" value="93#" class="cfoilspecName is_click" onclick="changoilspec2($(this))"><input type="hidden" name="cfoilspecid" ' +
        '  <c:if test="${department.fnameL2 == '南昌机动车驾驶员培训中心'}">value="DaMAAAA5cxt6qQrU"</c:if> <c:if test="${department.fnameL2 == '江西国力机动车驾驶员培训有限公司'}">value="DaMAAACriON6qQrU"</c:if>></td>'
    str+='<td><input type="text" name="cfqty" value="" class="cfqty"  onblur="countqty2($(this))"><input type="hidden" value=""></td><td><input type="text" name="cfdesc" value=""></td></tr>'
    $("#table1").append(str);
    //处理序号
    $('input:text[name=fseq]').each(function(j){
        j+=1
        $(this).val(j)
    })
}
//弹出车辆摸态框
var car;//车对象
function changcar(obj){
	car = obj;//给车辆对象赋值
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data1').css('visibility','visible')
	$('input:checkbox').removeAttr('checked');
}
//单击车辆
$(".xysj td").live('click',function(){
   $('input:checkbox[name=train]:checked').each(function(i) {
   	$(this).removeAttr("checked");
    });
      $(this).parent().find("input:checkbox").attr('checked','checked');
 })
 //双击确定车辆
$(document).on('dblclick','.xysj td',function(){
	addCarMesg(this);
})
//确认按钮把车辆数量填入
$(".subtn1").click(function (){
	addCarMesg();
})
//添加车辆信息
function addCarMesg(){
    var carId;//车id
    var carFnumber;//车编号
    var carType;//c车类型
    var depname;//部门
    $('input:checkbox[name=train]:checked').each(function (i) {
        if (0 == i) {
            carId = $(this).val();
            carType = $(this).parent().next().text();
            carFnumber = $(this).parent().next().next().text();
            depname = $(this).parent().parent().find("td").eq("20").text();
        }
    });
    //alert(carId+"车型: "+carType+"车号: "+carFnumber+" 部门:"+depname)
    //填充数据
    car.val(carFnumber)
    car.next().val(carId)
    car.parent().next().children("input:text[name=cfcartype]").val(carType)
    car.parent().next().next().children("input:text[name=cfdepname]").val(depname)

    $('#modal-overlay').css('visibility','hidden')
    $('.modal-data1').css('visibility','hidden')
    $('input:checkbox').removeAttr('checked');

    var $this = car
    $.ajax({
        url:'<%=path%>/DrivingSys/selPersonByCarId',
        type: "post",
        data:{'carId':carId},
        dataType:"json",
        success:function(json){
            if(json.length == 0){
                $this.parent().next().next().next().children("input:text[name=cftrainid]").val("")
                $this.parent().next().next().next().children("input:text[name=cftrainName]").val("")
            }else {
                $this.parent().next().next().next().children("input:text[name=cftrainid]").val(json[0].fid)
                $this.parent().next().next().next().children("input:text[name=cftrainName]").val(json[0].fnameL2)
            }
        },
        error: function(){
            /* alert(XMLHttpRequest.readyState +" "+ XMLHttpRequest.status +" "+ XMLHttpRequest.responseText);  */
            alert('错误！！！');}
    })
    car = null;//清空car对象
}
//弹出教练框
var trainName;//教练对象
function changtrain(obj){
	trainName = obj //给教练对象赋值
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data3').css('visibility','visible')
	$('input:checkbox').removeAttr('checked');
}
//弹出教练队摸态框
var team;//教练队对象
function changteam(obj){
	team = obj;//把选中需要修改的教练队对象保存下来
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data4').css('visibility','visible')
	$('input:checkbox').removeAttr('checked');
}
//单击教练队
$(".coachteam td").live('click',function(){
   $('input:checkbox[name=team]:checked').each(function(i) {
   	$(this).removeAttr("checked");
    });
      $(this).parent().find("input:checkbox").attr('checked','checked');
 })
 //双击确定车辆
$(document).on('dblclick','.coachteam td',function(){
	var teamId;//教练队id
	var teamName;//教练队名
	 $('input:checkbox[name=team]:checked').each(function(i) {
		 teamId = $(this).val();
		 teamName = $(this).parent().next().text();
		 //alert(teamId+" "+teamName)
	});
	team.val(teamName)
	team.next().val(teamId)
	//清空教练队对象
	team = null;
	$('#modal-overlay').css('visibility','hidden')
	$('.modal-data4').css('visibility','hidden')
	$('input:checkbox').removeAttr('checked');
})
$(".subtn4").click(function(){
	var teamId;//教练队id
	var teamName;//教练队名
	 $('input:checkbox[name=team]:checked').each(function(i) {
		 teamId = $(this).val();
		 teamName = $(this).parent().next().text();
		 //alert(teamId+" "+teamName)
	});
	if(teamId == null){
		alert("请勾选需要选中的行！")
		return false;
	}
	team.val(teamName)
	team.next().val(teamId)
	//清空教练队对象
	team = null;
	$('#modal-overlay').css('visibility','hidden')
	$('.modal-data4').css('visibility','hidden')
	$('input:checkbox').removeAttr('checked');
})
//根据名称查找教练队
$(".findBtn4").click(function(){
	var name = $(".name4").val();
	$.ajax({
		url:'<%=path%>/DrivingSys/queryTeamByName2',
	    type: "post",
	    data:{'name':name},
	    dataType:"json",
	    success:function(json){
	    	var str = '';
	    	for (var i = 0; i < json.length; i++) {
	    		str='<tr class="coachteam">'
	        	str+='<td><input style="width: 20px;" type="checkbox" class="check" name="team" value="'+json[i].fid+'"/></td>'
	        	str+='<td>'+json[i].fnameL2+'</td><td>'+json[i].fnumber+'</td><td>'+json[i].fsimplename+'</td><td>'+json[i].fdescriptionL2+'</td>'
	        	str+='<td>'+json[i].fcreatetime+'</td><td>'+json[i].createName+'</td><td>'+json[i].createName+'</td>'
	        	str+='<td>'+json[i].flastupdatetime+'</td><td>'+json[i].companyName+'</td>'
	        	if(json[i].cfkemu == 1){
	        		str+='<td>科目一</td>'
	        	}else if(json[i].cfkemu == 2){
	        		str+='<td>科目二</td>'
	        	}else if(json[i].cfkemu == 3){
	        		str+='<td>科目三</td>'
	        	}else{
	        		str+='<td>科目四</td>'
	        	}
	        	str+='<td>'+json[i].teamName+'</td></tr>'
	    	}
	    	$(".head4 tr:not(':first')").remove()
			$('.head4').append(str)
	   },
			error: function(){
				/* alert(XMLHttpRequest.readyState +" "+ XMLHttpRequest.status +" "+ XMLHttpRequest.responseText);  */
				alert('错误！！！');}
	})
})
//弹出教练组框
var group;//教练组对象
function changgroup(obj){
	group = obj;//把需要添加的对象赋值给教练组对象
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data5').css('visibility','visible')
	$('.page').show()
	$('input:checkbox').removeAttr('checked');
}

//单据选中教练组
$(".coacegroup td").live('click',function(){
   $('input:checkbox[name=group]:checked').each(function(i) {
   	$(this).removeAttr("checked");
    });
     $(this).parent().find("input:checkbox").attr('checked','checked');
 })
//双击确定教练组
$(document).on('dblclick','.coacegroup td',function(){
	var groupId;//教练组id
	var groupName;//教练组名
	 $('input:checkbox[name=group]:checked').each(function(i) {
		 groupId = $(this).val();
		 groupName = $(this).parent().next().text();
		 //alert(groupId+" "+groupName)
	});
	group.val(groupName)
	group.next().val(groupId)
	//清空教练队对象
	group = null;
	$('#modal-overlay').css('visibility','hidden')
	$('.modal-data5').css('visibility','hidden')
	$('input:checkbox').removeAttr('checked');
})
//确定按钮教练组
$(".subtn5").click(function (){
	var groupId;//教练组id
	var groupName;//教练组名
	 $('input:checkbox[name=group]:checked').each(function(i) {
		 groupId = $(this).val();
		 groupName = $(this).parent().next().text();
		 //alert(groupId+" "+groupName)
	});
	group.val(groupName)
	group.next().val(groupId)
	//清空教练队对象
	group = null;
	$('#modal-overlay').css('visibility','hidden')
	$('.modal-data5').css('visibility','hidden')
	$('input:checkbox').removeAttr('checked');
})

//弹油规格摸态框
var oilspec;//油规格对象
function changoilspec2(obj){
	oilspec = obj;//把需添加的油规格对象赋值
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data6').css('visibility','visible')
	$('input:checkbox').removeAttr('checked');
}
//单击选中 油规格的信息
$(".head6 tr td").live('click',function(){
	 $('input:checkbox[name=oilspec]:checked').each(function(i) {
		   	$(this).removeAttr("checked");
	});
	$(this).parent().find("input:checkbox").attr('checked','checked');
})
//双击确定 油规格信息
$(document).on('dblclick','.oilspec td',function(){
	var oilspecId;//教练组id
	var oilspecName;//教练组名
	 $('input:checkbox[name=oilspec]:checked').each(function(i) {
		 oilspecId = $(this).val();
		 oilspecName = $(this).parent().next().text();
		 //alert(oilspecId+" "+oilspecName)
	});
	oilspec.val(oilspecName)
	oilspec.next().val(oilspecId)
	//清空教练队对象
	oilspec = null;
	$('#modal-overlay').css('visibility','hidden')
	$('.modal-data6').css('visibility','hidden')
	$('input:checkbox').removeAttr('checked');
})
//确定把油规格信息填入
$(".subtn6").click(function (){
	var oilspecId;//教练组id
	var oilspecName;//教练组名
	 $('input:checkbox[name=oilspec]:checked').each(function(i) {
		 oilspecId = $(this).val();
		 oilspecName = $(this).parent().next().text();
		// alert(oilspecId+" "+oilspecName)
	});
	oilspec.val(oilspecName)
	oilspec.next().val(oilspecId)
	//清空教练队对象
	oilspec = null;
	$('#modal-overlay').css('visibility','hidden')
	$('.modal-data6').css('visibility','hidden')
	$('input:checkbox').removeAttr('checked');
})
//设置全选功选
$('.check').click(function(){
	if($(this).attr("checked")){
		 $("input:checkbox[name=check2]").prop("checked",true)
	}else{
		$('input:checkbox[name=check2]').removeAttr('checked')
	}
})
//由于和input:checkbox冲突，在选择一次
$("#table1 tr td input:checkbox[name=check2]").live('click',function(){
 if($(this).is(':checked')){
    	$(this).removeAttr("checked");
    }else{
    	$(this).attr("checked",":checked")
    }
})
//单击选中
$("#table1 tr td").live('click',function(){
	if($(this).parent().find("input:checkbox[name=check2]").is(':checked')){
		$(this).parent().find("input:checkbox[name=check2]").removeAttr("checked");
	}else{
		$(this).parent().find("input:checkbox[name=check2]").attr("checked",":checked")
	}
})
//计算总的加油量
function countqty2(obj){
	//避免最后一个字符串是.
 	obj.val((obj.val().replace(/\.$/g, "")));
    /*if(isNaN(Number(obj.valueOf()))){
        obj.val("");
    }*/
    if(isNaN(Number(obj.val()))){
        obj.val("")
    }
	var count = obj.val();//输入的数量
	if(count == null || count == ''){
		count = 0;
	}
	obj.val(count);
	//计算总数量
	cfqty();
}
function cfqty(){
	 var cfqty = 0;
		$(".cfqty").each(function(i){
			var s = $(this).val();
			if(s == null || s == ''){
				s = 0;
			}
			cfqty = (cfqty*1) + (s*1);
			cfqty = decimal(cfqty,2);
		})
		$("#cfqty").val(cfqty)
}
//删除选中的行
$(".deleteTable").click(function (){
	var k=0;//记录被选中复选框的个数
	$("input:checked[name=check2]").each(function (i){
		k++;
	})
	if(k == 0){
    	alert("请勾选中需要删除的行！")
    	return false;
	}else{
		$("input:checked[name=check2]").each(function (i){
			$(this).parent().parent().remove();
			//删除后把总的数量和总金额重新计算一遍
			cfqty();//算总数量
			//处理序号
			$('input:text[name=fseq]').each(function(j){
				j+=1
				$(this).val(j)
			})
		})
	}
})
//num是要处理的数字  v为要保留的小数位数
function decimal(num,v){
	var vv = Math.pow(10,v);
return Math.round(num*vv)/vv;
}

//键盘事件
$(".cfqty").live('keyup', function(event) {
		//最后一位是小数点的话，移除
		var $amountInput = $(this);
		//响应鼠标事件，允许左右方向键移动
		event = window.event || event;
		if(event.keyCode == 37 | event.keyCode == 39) {
			return;
		}
		//先把非数字的都替换掉，除了数字和.
		$amountInput.val($amountInput.val().replace(/[^\-?\d.]/g, "").
		//只允许一个小数点
		replace(/^\./g, "").replace(/\.{2,}/g, ".").
		//只能输入小数点后两位
		replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'));
});
//返回
function back(){
	location = '<%=path%>/DrivingSys/queryCarRefuel/look.action';
}
//改变审核状态
function audit(num) {
    var fid = $("input:hidden[name=fid]").val();
    var fnumber =$("input:text[name=fnumber]").val();
    if(num == 3){//反审核
        $('#modal-overlay').css('visibility', 'visible');
        $('.modal-data10').css('visibility', 'visible');
        $("#againstAuditsubmit").click(function(){
            var againstAuditcomment = $("#againstAuditcomment").val();
            if (againstAuditcomment == null || againstAuditcomment == '') {
                againstAuditcomment = "不同意";
            }
            $.ajax({
                url:'<%=path%>/DrivingSys/againstCheckCarRefuelActiviti',
                type:'post',
                data:{'fid':fid,'fnumber':fnumber,'againstAuditcomment':againstAuditcomment},
                dataType:'html',
                success:function(result){
                    if(result == 'success'){
                        showAlert("反审核成功!","queryCarRefuel/look.action")
                        <%--/*alert("反审核成功!")--%>
                        <%--setTimeout(function () {--%>
                            <%--location="<%=path%>/DrivingSys/queryCarRefuel/look.action";--%>
                        <%--}, 1000);*/--%>
                    }else{
                        alert("反审核失败!")
                    }
                },
                error:function () {alert('Error')}
            })
        })
    }
    if(num == 4){//提交
        $.messager.confirm('提示', '是否提交?', function (r) {
            if(r){
                $.ajax({
                    url:'<%=path%>/DrivingSys/submitCarRefuelActiviti',
                    type:'post',
                    data:{'fid':fid,'fnumber':fnumber},
                    dataType:'html',
                    success:function(result){
                        if(result == 'success'){
                            showAlert("提交成功!","queryCarRefuel/look.action")
                            <%--/*alert("提交成功!")--%>
                            <%--setTimeout(function () {--%>
                                <%--location="<%=path%>/DrivingSys/queryCarRefuel/look.action";--%>
                            <%--}, 1000);*/--%>
                        }else{
                            alert("提交失败!")
                        }
                    },
                    error:function () {alert('Error')}
                })
			}
		})
    }
    if(num == 5){//审核
        $('#modal-overlay').css('visibility', 'visible');
        $('.modal-data9').css('visibility', 'visible');
        $("#auditsubmit").click(function() {
            var agree = $("input:radio[name=check]:checked").val();//同意不同意
            var auditcomment = $("#auditcomment").val();
            if (agree == null) {
                alert("你选择你的意见");
                return false;
            }
            if (auditcomment == null || auditcomment == '') {
                if(agree == "1"){
                    auditcomment = "同意";
                }else{
                    auditcomment = "不同意";
                }
            }
            $.ajax({
                url:'<%=path%>/DrivingSys/checkCarRefuelActiviti',
                type:'post',
                data:{'fid':fid,'fnumber':fnumber,'agree':agree,'auditcomment':auditcomment},
                dataType:'html',
                // async: true,
                success:function(result){
                    if(result == 'success'){
                        showAlert("审核成功!","queryCarRefuel/look.action")
                       <%--/* alert("审核成功!")--%>
                        <%--setTimeout(function () {--%>
                            <%--location="<%=path%>/DrivingSys/queryCarRefuel/look.action";--%>
                        <%--}, 1000);*/--%>

                    }else{
                        alert("审核失败!")
                    }
                },
                error:function () {alert('Error')}
            })
        })
    }
}
//验证没有子数据不能保存
function subForm() {
    var count =0;
    $("input:checkbox[name=check2]").each(function (i) {
        count++;
    })
    var cfjypersonName = $(".cfjypersonName").val();
    if(cfjypersonName == null || cfjypersonName ==''){
        alert("加油人不能为空!")
        return false;
    }
    if(count==0){
        alert("至少添加一条数据!")
        return false;
    }
    //循环必填项不能为空
	$(".is_click").each(function (i) {
		if($(this).val() == ''){
			return false;
		}else{
            $("input[type='submit']").attr("disabled", "disabled");
		}
    })
    return true;
}
</script>
</html>